
<div class="indexWidth">
    <button type="button" class="btn btn-info mainButtonRight"><a
            href="javascript:takeout.openMenu('${ctxPath!}/news/list?cid=${categoryid!}&isbanner=${isbanner!}', null)" class="mianAcolor">返回</a></button>

    <div class="sectionTitle">
        资讯管理
        <hr>
    </div>
<form id="newsForm" name="form1" action="${ctxPath!}/news/save?cid=${categoryid!}&isbanner=${isbanner!}" method="POST" class="form-horizontal" enctype="multipart/form-data">
    <input type="hidden" id="id" name="news.id" value="${news.id!}"/>
    <div id="tab" class="btn-group" data-toggle="buttons-radio" style="margin-left: 100px">
        <a href="#htmlimage" class="btn btn-large btn-info  active" data-toggle="tab">填写网址</a>
        <a href="#fileimage" class="btn btn-large btn-info" data-toggle="tab">选择文件</a>
    </div>
    <div class="tab-content" style="margin-top: 10px">

        <div class="tab-pane active" id="htmlimage">
            <div class="articleFormLabel"  style="display: flex;align-items:center;" >
                <label class="mainSetConsistentWidth">封面图片：</label>
                <input type="text" name="news.img" target="_blank"     style="margin-top: 4px" class="mainSetWidth" value="${news.img!}" placeholder="" />
            </div>
        </div>
        <div class="tab-pane " id="fileimage">
            <div class="articleFormLabel"   style="display: flex;align-items:center;">
                <label class="mainSetConsistentWidth">封面图片：</label>
                <input type="file" id="grouping" name="img" class="mainSetWidth" >
                <a href="${news.img!}" target="_blank" style="margin-left: 10px;">查看图片(图片大小无限制)</a>
            </div>
        </div>
    </div>

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">类别：</label>
        <#oneToManyTag val="${news.categoryid!}" type="select" table="category" columnName="name" class="mainSetWidth"
                pname="news.categoryid" defaultNumber="1" whereSel="parentid" whereArgs="2"></#oneToManyTag>
    </div>

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">是否VIP：</label>
        <#dictTag val="${news.isvip!}" type="select" group="yes_no"  pname="news.isvip" defaultNumber="2"></#dictTag>
    </div>

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">是否推荐：</label>
        <#dictTag val="${news.isbanner!}" type="select" group="yes_no"  pname="news.isbanner" defaultNumber="2"></#dictTag>
    </div>

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">标题：</label>
        <input type="text" id="According" name="news.title" class="mainSetWidth" value="${news.title!}" placeholder=""  valid="vtext" validname="标题"/>
    </div>

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">作者：</label>
        <input type="text" name="news.author" class="mainSetWidth" value="${news.author!}" />
    </div>

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">密码：</label>
        <input type="text" name="news.passwd" class="mainSetWidth" value="${news.passwd!}" />
    </div>

    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">新闻来源：</label>
        <input type="text" name="news.from" class="mainSetWidth" value="${news.from!}" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">阅读量：</label>
        <input type="text" name="news.readtimes" class="mainSetWidth" value="${news.readtimes!}" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">点赞量：</label>
        <input type="text" name="news.favtimes" class="mainSetWidth" value="${news.favtimes!}" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">APPID：</label>
        <input type="text" name="news.wxappid" class="mainSetWidth" value="${news.wxappid!}" placeholder="" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">APPURL：</label>
        <input type="text" name="news.wxppurl" class="mainSetWidth" value="${news.wxppurl!}" placeholder="" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">推荐微信语：</label>
        <input type="text" name="news.wxnum_word" class="mainSetWidth" value="${news.wxnum_word!}" placeholder="" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">推荐微信号：</label>
        <input type="text" name="news.wxnum" class="mainSetWidth" value="${news.wxnum!}" placeholder="" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">视频地址：</label>
        <input type="text" name="news.videourl" class="mainSetWidth" value="${news.videourl!}" placeholder="" />
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">中断时间(秒)：</label>
        <input type="text" name="news.interrupttime" class="mainSetWidth" value="${news.interrupttime!}" placeholder="" onkeyup="nan(this)" onchange="nan(this)"/>
    </div>
    <div class="articleFormLabel">
        <label class="mainSetConsistentWidth">详情内容：</label>
        <!--<div id="content">${news.content!}</div>
        <textarea id="news_content" rows="12" name="news.content" class="mainSetWidth">${news.content!}</textarea>-->
        <textarea name="news.content" id="news_content" style="width:800px;height:400px;">${news.content!}</textarea>

    </div>

    <div class="form-group">
        <button style="margin-left: 100px;width:95px;" class="btn btn-info articleFormButton" type="button"
                onclick="oper.save()">保存
        </button>
    </div>

    <script type="text/javascript">
        function nan(t){
            t.value=t.value.replace(/[^\d]/g,"");
        }
        var oper = {
            save:function(){
                if(!validForm()) {
                    return false;
                }
                takeout.ajaxFormMainPanel('newsForm')
                return true;
            }
        };
    </script>
    <script>
        KindEditor.ready(function(K) {
            window.editor = K.create('#news_content', {
                afterCreate: function () {
                    var self = this;
                    K.ctrl(document, 13, function () {
                        self.sync();
                        K('form[name=form1]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function () {
                        self.sync();
                        K('form[name=form1]')[0].submit();
                    });
                },
                afterBlur: function () { this.sync(); },
                allowImageUpload : true,
                uploadJson : '${ctxPath!}/news/uplodImg'
            });
        });
    </script>
</form>